package jgl.vajra.management.part.mine.model;


import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import jgl.vajra.management.bean.CarDocumentTypeBean;
import jgl.vajra.management.part.mine.contract.CarInformationContract;
import jgl.vajra.management.utils.RandomUtils;
import jgl.vajra.management.widget.manager.RxJavaHttpManager;
import jgl.vajra.management.widget.manager.retrofit.RetrofitJsonManager;
import jgl.vajra.management.widget.retrofithelper.utils.AEACCoder;

public class CarInformationModel extends CarInformationContract.Model{

    @Override
    public Observable<String> getRandomOrderNumber() {
        return RetrofitJsonManager.getInstance().getApiService().getRandomOrderNumber(AEACCoder.encrypt(RandomUtils.getRandom()))
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<List<CarDocumentTypeBean>> getCarDocumentTypeData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getCarDocumentTypeData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }
}
